package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {
    /**
     * 根据openid查询用户师傅存在
     * @param openId
     * @return
     */
    @Select("select * from sky_take_out.user where openid = #{openId};")
    User getByOpenId(String openId);

    /**
     * 为用户插入数据
     * @param user
     */
    void insert(User user);

    /**
     * 根据动态条件查询用户数量
     * @param map
     * @return
     */
    Integer countBymap(Map map);
}
